package com.panshi.service.impl;

import com.panshi.service.IAdminApp;
import com.panshi.vo.DataResult;
import com.panshi.vo.SysAdmin;
import com.panshi.vo.SysRole;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Controller;

import java.util.List;

@Controller
public class AdminApiFallbackFactory implements FallbackFactory<IAdminApp> {

    @Override
    public IAdminApp create(Throwable throwable) {
        System.out.println("服务降级 ------------>");
        return new IAdminApp() {
            @Override
            public DataResult findAdmin() {
                return new DataResult();
            }

            @Override
            public SysAdmin findAdminById(Integer id) {
                return new SysAdmin();
            }

            @Override
            public Boolean upd(SysAdmin sysAdmin) {
                return false;
            }

            @Override
            public Boolean add(SysAdmin sysAdmin) {
                return false;
            }

            @Override
            public Boolean del(Integer id) {
                return false;
            }

            @Override
            public List<SysAdmin> findAdminGrade() {
                return null;
            }

        };
    }
}
